home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000…tember: Reference Library / Dev.CD Sep 00 RL Disk 1.toast / mac / Technical Documentation / Develop / develop Issue 26 / develop Issue 26 code / SOM and ListPart / ListPart DR4 / Source / ListPart.r < prev    next >
Encoding:
Text File  |  1995-11-08  |  11.9 KB  |  518 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ListPart.r
  3.  
  4.     Contains:    ListPart Resources
  5.  
  6.     Written by:    Steve Smith
  7.  
  8.     Copyright:    © 1994-95 by Apple Computer, Inc., all rights reserved.
  9. */
  10.  
  11. #define SystemSevenOrBetter 1            // we want the extended types
  12. #define    SystemSevenOrLater    1            // Types.r uses this variable
  13.  
  14. // -- MPW Rez Includes --
  15.  
  16. #include "Types.r"
  17. #include "SysTypes.r"
  18. #include "CodeFragmentTypes.r"
  19.  
  20. // -- OpenDoc Includes --
  21.  
  22. #ifndef __ODTYPES_R__
  23. #include "ODTypes.r"
  24. #endif
  25.  
  26. #ifndef SOM_Module_OpenDoc_StdDefs_defined
  27. #include "StdDefs.r"
  28. #endif
  29.  
  30. // -- ListPart Includes --
  31.  
  32. #ifndef _LISTPARTDEF_
  33. #include "ListPartDef.h"
  34. #endif
  35.  
  36. #ifndef _LISTPARTVERS_
  37. #include "ListPartVers.h"
  38. #endif
  39.  
  40. //-------------------------------------------------------------------------------------
  41. // .rsrc resources
  42. //-------------------------------------------------------------------------------------
  43.  
  44. // ListPart - This gets the resources from my .rsrc file (PICTs etc.)
  45. include "ListPartOtherResources.rsrc";
  46.  
  47. //-------------------------------------------------------------------------------------
  48. // Finder Version Resources
  49. //-------------------------------------------------------------------------------------
  50.  
  51. // Part's Finder Version Resource
  52.  
  53. resource 'vers' (1) {
  54.     currentMajorVersion,
  55.     finderMinorVersion,
  56.     developmentStage,
  57.     preReleaseNumber,
  58.     verUS,
  59.     shortVersionStr,
  60.     shortVersionStr", © Apple Computer, Inc. 1994-1995"
  61. };
  62.  
  63. resource 'vers' (2) {
  64.     currentMajorVersion,
  65.     finderMinorVersion,
  66.     developmentStage,
  67.     preReleaseNumber,
  68.     verUS,
  69.     shortVersionStr,
  70.     "OpenDoc™ Sample Code"
  71. };
  72.  
  73. //-------------------------------------------------------------------------------------
  74. // Code Fragment Resources
  75. //-------------------------------------------------------------------------------------
  76.  
  77. resource 'cfrg' (0) {
  78.     {    /* [1] */
  79. #ifdef _68KBUILD_
  80.         kMotorola,
  81. #else
  82.         kPowerPC,
  83. #endif
  84.         kFullLib,
  85.         currentVersion,
  86.         compatibleVersion,
  87.         kDefaultStackSize,
  88.         kNoAppSubFolder,
  89.         kIsLib,
  90.         kOnDiskFlat,
  91.         kZeroOffset,
  92.         kWholeFork,
  93.         kListPartID,        /* This must be the class ID. */
  94.         /* [2] */
  95. #ifdef _68KBUILD_
  96.         kMotorola,
  97. #else
  98.         kPowerPC,
  99. #endif
  100.         kFullLib,
  101.         currentVersion,
  102.         compatibleVersion,
  103.         kDefaultStackSize,
  104.         kNoAppSubFolder,
  105.         kIsLib,
  106.         kOnDiskFlat,
  107.         kZeroOffset,
  108.         kWholeFork,
  109.         kPartClassName        /* This must be the SOM class name */
  110.                             /* for this part.                   */
  111.     }
  112. };
  113.  
  114. //-------------------------------------------------------------------------------------
  115. // NMAP Resources
  116. //-------------------------------------------------------------------------------------
  117.  
  118. // Map a part's class id (module::classname)
  119. // to a part's kind (unique content identifier)
  120. //
  121. resource kODNameMappings (kEditorKindMapId) {
  122.     kODEditorKinds,
  123.     {    /* array Types: 1 elements */
  124.         /* [1] */
  125.         kListPartID,
  126.         kODIsAnISOStringList
  127.         {
  128.             {    /* array ClassIDs: 1 elements */
  129.                 /* [1] */
  130.                 kListPartKind
  131.             }
  132.         }
  133.     }
  134. };
  135.  
  136. // Map a part's class id (module::classname)
  137. // to a human readable string.
  138. //
  139. resource kODNameMappings (kEditorUserStringMapId) {
  140.     kODEditorUserString,
  141.     {    /* array Types: 1 elements */
  142.         /* [1] */
  143.         kListPartID,
  144.         kODIsINTLText
  145.         {
  146.             smRoman,
  147.             langEnglish,
  148.             kListPartEditorUserString
  149.         }
  150.     }
  151. };
  152.  
  153. // Map a part's kind (unique content identifier)
  154. // to a generic content category identifier.
  155. //
  156. resource kODNameMappings (kKindCategoryMapId) {
  157.     kODKind,
  158.     {    /* array Types: 1 elements */
  159.         /* [1] */
  160.         kListPartKind,
  161.         kODIsAnISOStringList
  162.         {
  163.             {    /* array ClassIDs: 1 elements */
  164.                 /* [1] */
  165.                 kListPartCategory
  166.             }
  167.         }
  168.     }
  169. };
  170.  
  171. // Map a part's kind (unique content identifier)
  172. // to a human readable string.
  173. //
  174. resource kODNameMappings (kKindUserStringMapId) {
  175.     kODKindUserString,
  176.     {    /* array Types: 1 elements */
  177.         /* [1] */
  178.         kListPartKind,
  179.         kODIsINTLText
  180.         {
  181.             smRoman,
  182.             langEnglish,
  183.             kListPartKindUserString
  184.         }
  185.     }
  186. };
  187.  
  188. // Map a part's generic content category identifier
  189. // to a human readable string.
  190. //
  191. resource kODNameMappings (kCategoryUserStringMapId) {
  192.     kODCategoryUserString,
  193.     {    /* array KeyList: 1 elements */
  194.         /* [1] */
  195.         kListPartCategory,
  196.         kODIsINTLText {
  197.             smRoman,
  198.             langEnglish,
  199.             kListPartCategoryUserString
  200.         }
  201.     }
  202. };
  203.  
  204. // Map a part's kind (unique content identifier)
  205. // to an old style MacOS Type (and/or ScrapType).
  206. //
  207. resource kODNameMappings (kOldMacOSTypeMapId) {
  208.     kODKindOldMacOSType,
  209.     {    /* array KeyList: 1 elements */
  210.         /* [1] */
  211.         kListPartKind,
  212.         kODIsMacOSType {
  213.             kListPartDocumentOSType
  214.         }
  215.     }
  216. };
  217.  
  218. //-------------------------------------------------------------------------------------
  219. // OLE Interoperability Support
  220. //-------------------------------------------------------------------------------------
  221.  
  222. // This resource allows your editor to be registered with the OLE runtime on the
  223. // Macintosh and subsequently interoperate with OLE clients/servers. Contact Microsoft
  224. // to acqiure a unique class ID.
  225. resource 'olcr' (0, "OLE Class ID")
  226. {
  227.    "{80C11F40-7503-8576-00D01113F11}"; /* your part's CLSID */
  228. };
  229.  
  230. //-------------------------------------------------------------------------------------
  231. // String List Resources
  232. //-------------------------------------------------------------------------------------
  233.  
  234. resource 'STR#' (kMenuStringResID, "Menu Items strings") {
  235.     {    /* array StringArray: 3 elements */
  236.         /* [1] */
  237.         "About ListPart…",
  238.         /* [2] */
  239.         "PART",
  240.         /* [3] */
  241.         "Sample • Sample"
  242.     }
  243. };
  244.  
  245. resource 'STR#' (kErrorStringResID, "Error strings") {
  246.     {    /* array StringArray: 6 elements */
  247.         /* [1] */
  248.         "“ListPart” was unable completely initi"
  249.         "alize its internal structures.",
  250.         /* [2] */
  251.         "“ListPart” was unable to open the docu"
  252.         "ment due to unforseen circumstances.",
  253.         /* [3] */
  254.         "“ListPart” was unable to open a part w"
  255.         "indow due to unforseen circumstances.",
  256.         /* [4] */
  257.         "“ListPart” has been asked to remove a "
  258.         "frame that does not belong to it, or an "
  259.         "error occurred while removing the frame "
  260.         "from internal storage.",
  261.         /* [5] */
  262.         "A window that “ListPart” created has b"
  263.         "een deleted without its knowledge. This "
  264.         "may generate a fatal error in the near f"
  265.         "uture. Please close the document immedia"
  266.         "tely to prevent data loss.",
  267.         /* [6] */
  268.         "“ListPart” encountered a fatal error w"
  269.         "hile trying to save. Try saving again or"
  270.         " closing the document."
  271.     }
  272. };
  273.  
  274. //-------------------------------------------------------------------------------------
  275. // Finder Related Resources
  276. //-------------------------------------------------------------------------------------
  277.  
  278. // Kind resources affect the text Finder displays in the
  279. // "kind" column and file info dialog. This feature was
  280. // introduced as part of Macintosh Easy Open.
  281. //
  282. resource 'kind' (kBaseResourceID) {
  283.     kListPartEditorOSType,
  284.     0, /* region = USA */
  285.     {
  286.         'shlb', "OpenDoc™ editor"
  287.     }
  288. };
  289.     
  290. resource 'kind' (kBaseResourceID+1) {
  291.     kListPartViewerOSType,
  292.     0, /* region = USA */
  293.     {
  294.         'shlb', "OpenDoc™ viewer"
  295.     }
  296. };
  297.     
  298. resource 'kind' (kBaseResourceID+2) {
  299.     kODShellSignature,
  300.     0, /* region = USA */
  301.     {
  302.         kListPartDocumentOSType, "ListPart 1.0 document",
  303.         kListPartStationeryOSType, "ListPart 1.0 stationery"
  304.     }
  305. };
  306.  
  307. // The -16397 string will be displayed by Finder when a user
  308. // tries to open the editor shared library. The string should
  309. // give the user a little detail about the part's capabilities
  310. // and enough information to install the part in the correct location.
  311. //
  312. resource 'STR ' (-16397, purgeable) {
  313.     "OpenDoc™ editor\n\n“ListPart” demonstrates the functionality of a very "
  314.     "basic part. To work properly, it should be placed in the Editors folder. "
  315.     "To create a new document, open a stationery pad."
  316. };
  317.  
  318. //-------------------------------------------------------------------------------------
  319. // Dialog Resources
  320. //-------------------------------------------------------------------------------------
  321.  
  322. resource 'DLOG' (kAboutBoxID, "ListPart About Box") {
  323.     {0, 0, 250, 350},
  324.     dBoxProc,
  325.     invisible,
  326.     goAway,
  327.     0x0,
  328.     kAboutBoxID,
  329.     "",
  330.     alertPositionMainScreen
  331. };
  332.  
  333. resource 'DITL' (kAboutBoxID) {
  334.     {    /* array DITLarray: 8 elements */
  335.         /* [1] */
  336.         {222, 270, 242, 338}, Button { enabled, "OK" },
  337.         /* [2] */
  338.         {24, 25, 56, 57}, Picture { disabled, kEditorIconPicture },
  339.         /* [3] */
  340.         {13, 68, 237, 69}, Button { disabled, "" },
  341.         /* [4] */
  342.         {64, 13, 65, 337}, Button { disabled, "" },
  343.         /* [5] */
  344.         {46, 76, 62, 172}, StaticText { disabled, "ListPart" },
  345.         /* [6] */
  346.         {76, 76, 116, 304}, StaticText { disabled,
  347.             "ListPart is a sample part editor which"
  348.             " illustrates the functionality of a basi"
  349.             "c part editor." },
  350.         /* [7] */
  351.         {124, 76, 152, 304}, StaticText { disabled,
  352.             "Written by Steve Smith with support from"
  353.             " the OpenDoc™ Engineering team." },
  354.         /* [8] */
  355.         {172, 76, 200, 300}, StaticText { disabled,
  356.             "Copyright© 1994,1995 by Apple Computer, "
  357.             "Inc. All Rights Reserved." }
  358.     }
  359. };
  360.  
  361. resource 'dctb' (kAboutBoxID) {
  362.     /* dialog background fill color */
  363.     {    /* array ColorSpec: 5 elements */
  364.         /* [1] */
  365.         wContentColor, 59127, 59127, 59127,
  366.         /* [2] */
  367.         wFrameColor, 0, 0, 0,
  368.         /* [3] */
  369.         wTextColor, 0, 0, 0,
  370.         /* [4] */
  371.         wHiliteColor, 0, 0, 0,
  372.         /* [5] */
  373.         wTitleBarColor, 65535, 65535, 65535
  374.     }
  375. };
  376.  
  377. data 'ictb' (kAboutBoxID) {
  378.     /* dialog control text styling */
  379.     $"0000 0000 0000 0000 0028 0020 0028 0048"
  380.     $"8007 0070 8007 0084 8007 0098 8007 00AC"
  381.     $"0000 0000 0000 0003 0000 7FFF 7FFF 7FFF"
  382.     $"0001 FFFF FFFF FFFF 0002 0000 0000 0000"
  383.     $"0003 FFFF FFFF FFFF 0000 0000 0000 0003"
  384.     $"0000 7FFF 7FFF 7FFF 0001 FFFF FFFF FFFF"
  385.     $"0002 0000 0000 0000 0003 FFFF FFFF FFFF"
  386.     $"00C0 0100 000E 0000 0000 0000 FFFF FFFF"
  387.     $"FFFF 0000 00C9 0000 0009 0000 0000 0000"
  388.     $"FFFF FFFF FFFF 0000 00D0 0000 0009 0000"
  389.     $"0000 0000 FFFF FFFF FFFF 0000 00D7 0000"
  390.     $"0009 0000 0000 0000 FFFF FFFF FFFF 0000"
  391.     $"0850 616C 6174 696E 6F06 4765 6E65 7661"
  392.     $"0647 656E 6576 6106 4765 6E65 7661"
  393. };
  394.  
  395. resource 'DLOG' (kErrorBoxID, "ListPart Error Box") {
  396.     {57, 46, 244, 374},
  397.     dBoxProc,
  398.     invisible,
  399.     goAway,
  400.     0x0,
  401.     kErrorBoxID,
  402.     "",
  403.     alertPositionParentWindowScreen
  404. };
  405.  
  406. resource 'DITL' (kErrorBoxID) {
  407.     {    /* array DITLarray: 5 elements */
  408.         /* [1] */
  409.         {153, 256, 173, 314}, Button { enabled, "OK" },
  410.         /* [2] */
  411.         {153, 185, 173, 243}, Button { enabled, "Cancel" },
  412.         /* [3] */
  413.         {11, 70, 124, 317}, StaticText { disabled,
  414.             "<< Use this for errors in the Editor, su"
  415.             "ch as out of memory, unable to acquire s"
  416.             "ome system resource, etc.>> \nUser errors"
  417.             " use a standard alert appearance. See DI"
  418.             "TL 129.>>" },
  419.         /* [4] */
  420.         {11, 19, 43, 51}, Picture { disabled, kEditorIconPicture },
  421.         /* [5] */
  422.         {149, 252, 177, 318}, UserItem { disabled }
  423.     }
  424. };
  425.  
  426. //-------------------------------------------------------------------------------------
  427. // Finder Bundle Information
  428. //-------------------------------------------------------------------------------------
  429.  
  430. resource 'BNDL' (kDocumentBundle, "Document BNDL") {
  431.     kODShellSignature,
  432.     0,
  433.     {    /* array TypeArray: 2 elements */
  434.         /* [1] */
  435.         'FREF',
  436.         {    /* array IDArray: 2 elements */
  437.             /* [1] */
  438.             0, kDocumentFREF,
  439.             /* [2] */
  440.             1, kStationeryFREF
  441.         },
  442.         /* [2] */
  443.         'ICN#',
  444.         {    /* array IDArray: 2 elements */
  445.             /* [1] */
  446.             0, kDocumentIcons,
  447.             /* [2] */
  448.             1, kStationeryIcons
  449.         }
  450.     }
  451. };
  452.  
  453. resource 'BNDL' (kEditorBundle, "Editor BNDL") {
  454.     kListPartEditorOSType,
  455.     0,
  456.     {    /* array TypeArray: 2 elements */
  457.         /* [1] */
  458.         'FREF',
  459.         {    /* array IDArray: 1 elements */
  460.             /* [1] */
  461.             0, kEditorFREF
  462.         },
  463.         /* [2] */
  464.         'ICN#',
  465.         {    /* array IDArray: 1 elements */
  466.             /* [1] */
  467.             0, kEditorIcons
  468.         }
  469.     }
  470. };
  471.  
  472. resource 'BNDL' (kViewerBundle, "Viewer BNDL") {
  473.     kListPartViewerOSType,
  474.     0,
  475.     {    /* array TypeArray: 2 elements */
  476.         /* [1] */
  477.         'FREF',
  478.         {    /* array IDArray: 1 elements */
  479.             /* [1] */
  480.             0, kViewerFREF
  481.         },
  482.         /* [2] */
  483.         'ICN#',
  484.         {    /* array IDArray: 1 elements */
  485.             /* [1] */
  486.             0, kViewerIcons
  487.         }
  488.     }
  489. };
  490.  
  491. resource 'FREF' (kDocumentFREF) {
  492.     kListPartDocumentOSType, 0, ""
  493. };
  494.  
  495. resource 'FREF' (kStationeryFREF) {
  496.     kListPartStationeryOSType, 1, ""
  497. };
  498.  
  499. resource 'FREF' (kEditorFREF) {
  500.     'shlb', 0, ""
  501. };
  502.  
  503. resource 'FREF' (kViewerFREF) {
  504.     'shlb', 0, ""
  505. };
  506.  
  507. data kODShellSignature (0, "Owner resource") {
  508.     $"00"
  509. };
  510.  
  511. data kListPartViewerOSType (0, "Owner resource") {
  512.     $"00"
  513. };
  514.  
  515. data kListPartEditorOSType (0, "Owner resource") {
  516.     $"00"
  517. };
  518.